#ifndef PCB_H
#define PCB_H
#include<QString>
#include <ctime>
#include <QDebug>

enum STATUS {
    BACKUP, MACRORUN, READY, RUNNING, SUSPEND, TERMINATED
};

class PCB
{
public:
    PCB(QString, int, int, int);
    PCB(PCB * p);

    void setPID(QString);
    void setRuntime(int);
    void delRuntime(int);
    void setPriority(int);
    void delPriority(int);
    void setStatus(STATUS);
    void setNext(PCB *);
    void setMemoryNeed(int);
    void setMemoryBegin(int);
    void setColorOrder(int);

    QString getPID();
    int getRuntime();
    STATUS getStatus();
    int getPriority();
    int getMemoryNeed();
    int getMemoryBegin() const;
    int getColorOrder();

    void refreshColor();

private:
    QString pid;//进程名（pid)
    int runTime;//要求运行时间
    int priority;//优先权
    STATUS status;//状态
    PCB * next;//pcb指针
    int memoryNeed;//需要主存
    int memoryBegin;//主存起址

    int colorOrder;//展示效果，不同颜色
};

#endif // PCB_H
